package com.dfbz.demo01_卖票案例;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_多线程初体验 {

    public static void main(String[] args) {
        MyThread thread=new MyThread();

        // 开启线程,开启线程执行的是run
        thread.start();

        for (int i = 0; i < 10000; i++) {
            System.out.println("main....");
        }
    }
}

class MyThread extends Thread {

    private int num=100;

    // 封装了线程执行的任务
    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            System.out.println("MyThread..");
        }
    }
}